import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";

import commonRouter from "./modules/common";
import goodsConfigRouter from "./modules/goods-config";
import moduleAdminRouter from "./modules/module-admin";
import systemAdminRouter from "./modules/system-admin";

const routes: RouteRecordRaw[] = [
  ...commonRouter,
  ...goodsConfigRouter,
  ...moduleAdminRouter,
  ...systemAdminRouter,
  // 404
  {
    path: "/:pathMatch(.*)",
    name: "404",
    component: () => import('../views/404.vue')
  }
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
